Skip to content

[keyboard_detection] Add regression integration tests#1042

Open
seungsoo47 wants to merge 2 commits into
flutter-tizen:masterfrom
seungsoo47:keyboard_detection-add-integration-tests
Open

[keyboard_detection] Add regression integration tests#1042
seungsoo47 wants to merge 2 commits into
flutter-tizen:masterfrom
seungsoo47:keyboard_detection-add-integration-tests

Conversation

@seungsoo47

Copy link
Copy Markdown
Contributor

Expand the integration test suite for the keyboard detection controller from 2 to 20 cases, driving the input-panel event channel with simulated platform messages so the tests are deterministic and need no real keyboard:

  • Initial unknown state and unknown fallback for unrecognized events.
  • All keyboard states: visibling, visible, hiding, hidden.
  • stateAsBool mapping, including the transitional states with and without includeTransitionalState.
  • Keyboard metrics (width, height/size, position) updates on show with dimensions, reset on hide, and isSizeLoaded / ensureSizeLoaded.
  • Robustness against malformed events (non-map / missing or wrong-typed state).
  • Notifications via the state stream and the onChanged callback.
  • Registered callbacks: delivery, self-unregister on returning false, unregisterCallback and unregisterAllCallbacks.
  • No further state changes are reported after dispose.

This is a Tizen-exclusive plugin with no upstream package. Test-only change, recorded under a NEXT changelog entry without a version bump. Validated on a Raspberry Pi 4 (Tizen) device: 20 passed, 0 failed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds 18 integration test cases to the keyboard detection package, organizing them into groups covering state reporting, stateAsBool, keyboard metrics, notifications, registered callbacks, and lifecycle. Feedback suggests improving the test for ignoring invalid events by transitioning to a known state first to verify they are truly ignored, and removing redundant await tester.pump(); calls in the callback tests.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@seungsoo47 seungsoo47 force-pushed the keyboard_detection-add-integration-tests branch 2 times, most recently from 9b3c6ca to db0cb00 Compare June 18, 2026 03:19
Comment on lines +114 to +124
group('stateAsBool', () {
testWidgets('maps the transitional visibling state',
(WidgetTester tester) async {
final KeyboardDetectionController controller =
KeyboardDetectionController();
await emit(tester, <String, Object?>{'state': 'will_show'});
await tester.pump();
expect(controller.stateAsBool(), isFalse);
expect(controller.stateAsBool(true), isTrue);
await controller.dispose();
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is similar to the "reports visibling on will_show event" test.
Since it verifies the values ​​of each data point for the "will_show" state, I believe it can be integrated into a one test.
Please combine similar tests into one. They are essentially duplicate tests.

seungsoo47 and others added 2 commits June 22, 2026 13:23
Expand the integration test suite for the keyboard detection controller
from 2 to 20 cases, driving the input-panel event channel with simulated
platform messages so the tests are deterministic and need no real keyboard:

- Initial unknown state and unknown fallback for unrecognized events.
- All keyboard states: visibling, visible, hiding, hidden.
- stateAsBool mapping, including the transitional states with and without
  includeTransitionalState.
- Keyboard metrics (width, height/size, position) updates on show with
  dimensions, reset on hide, and isSizeLoaded / ensureSizeLoaded.
- Robustness against malformed events (non-map / missing or wrong-typed state).
- Notifications via the state stream and the onChanged callback.
- Registered callbacks: delivery, self-unregister on returning false,
  unregisterCallback and unregisterAllCallbacks.
- No further state changes are reported after dispose.

This is a Tizen-exclusive plugin with no upstream package. Test-only change,
recorded under a NEXT changelog entry without a version bump. Validated on a
Raspberry Pi 4 (Tizen) device: 20 passed, 0 failed.
…ing tests

Merge the stateAsBool group into the existing will_show and will_hide
state reporting tests, which already cover the same event setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@seungsoo47 seungsoo47 force-pushed the keyboard_detection-add-integration-tests branch from db0cb00 to 7fd41e2 Compare June 22, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants